#include "Factroy.h"

void ProductA::ProductOperation()
{
	cout << "It's Product A" << endl;
}

void ProductB::ProductOperation()
{
	cout << "It's Product B" << endl;
}

IProduct* ProductBFactory::CreateProduct()
{
	return new ProductB;
}

IProduct* ProductAFactory::CreateProduct()
{
	return new ProductA;
}

int main()
{
	IFactroy *factoryA = new ProductAFactory;
	IProduct *productA = factoryA->CreateProduct();

	productA->ProductOperation();

	IFactroy *factoryB = new ProductBFactory;
	IProduct *productB = factoryB->CreateProduct();

	productB->ProductOperation();	
}
